<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>vue</title>
    <script type="text/javascript" src="../../js/vue.js"></script>

</head>
<body>
    <div id="root">
        <!-- 遍历数组 -->
        <ul>
            <li v-for= "(p,index) in persons" :key="p.id">
                {{p.name}} - {{p.age}} - {{index}}
            </li>
        </ul>
        <hr>
        <!-- 遍历对象 -->
        <ul>
            <li v-for= "(value,key) in car" :key="key">
                {{key}} - {{value}}
            </li>
        </ul>
        <hr>
        <!-- 遍历字符串 -->
        <ul>
            <li v-for= "(k,index) in str" :key="index">
                {{k}} - {{index}}
            </li>
        </ul>
        <hr>
        <!-- 遍历指定次数 -->
        <ul>
            <li v-for= "(k,index) in 5" :key="index">
                {{k}} - {{index}}
            </li>
        </ul>
    </div>

    <script type="text/javascript">
        Vue.config.performance = false;
        const vm = new Vue({
            el:'#root',
            data:{
                persons:[
                    {id:'001',name:"zw",age:12},
                    {id:'002',name:"ls",age:18},
                    {id:'003',name:"sd",age:20}
                ],
                car:{
                    name:'audo',
                    price:'70',
                    color:'黑色'
                },
                str:'hello'
            }
        })

    </script>

</body>
</html>